Optimal. Leaf size=29 \[ a x+b x \tanh ^{-1}\left (\frac {c}{x}\right )+\frac {1}{2} b c \log \left (c^2-x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {6021, 269, 266}
\begin {gather*} a x+\frac {1}{2} b c \log \left (c^2-x^2\right )+b x \tanh ^{-1}\left (\frac {c}{x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 266
Rule 269
Rule 6021
Rubi steps
\begin {align*} \int \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right ) \, dx &=a x+b \int \tanh ^{-1}\left (\frac {c}{x}\right ) \, dx\\ &=a x+b x \tanh ^{-1}\left (\frac {c}{x}\right )+(b c) \int \frac {1}{\left (1-\frac {c^2}{x^2}\right ) x} \, dx\\ &=a x+b x \tanh ^{-1}\left (\frac {c}{x}\right )+(b c) \int \frac {x}{-c^2+x^2} \, dx\\ &=a x+b x \tanh ^{-1}\left (\frac {c}{x}\right )+\frac {1}{2} b c \log \left (c^2-x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.00, size = 29, normalized size = 1.00 \begin {gather*} a x+b x \tanh ^{-1}\left (\frac {c}{x}\right )+\frac {1}{2} b c \log \left (c^2-x^2\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 48, normalized size = 1.66
method | result | size |
default | \(a x +b x \arctanh \left (\frac {c}{x}\right )+\frac {b c \ln \left (1+\frac {c}{x}\right )}{2}-b c \ln \left (\frac {c}{x}\right )+\frac {b c \ln \left (\frac {c}{x}-1\right )}{2}\) | \(48\) |
derivativedivides | \(-c \left (-\frac {a x}{c}-\frac {b x \arctanh \left (\frac {c}{x}\right )}{c}-\frac {b \ln \left (1+\frac {c}{x}\right )}{2}+b \ln \left (\frac {c}{x}\right )-\frac {b \ln \left (\frac {c}{x}-1\right )}{2}\right )\) | \(55\) |
risch | \(a x +\frac {b x \ln \left (x +c \right )}{2}-\frac {b \ln \left (c -x \right ) x}{2}-\frac {i b \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2} x}{4}-\frac {i b \pi \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{3} x}{4}+\frac {i b \pi \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2} x}{2}-\frac {i b \pi \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{3} x}{4}+\frac {i b \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (c -x \right )\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right ) x}{4}-\frac {i b \pi \,\mathrm {csgn}\left (i \left (c -x \right )\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2} x}{4}+\frac {i b \pi \,\mathrm {csgn}\left (i \left (x +c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{2} x}{4}-\frac {i b \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x +c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right ) x}{4}+\frac {i b \pi \,\mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{2} x}{4}-\frac {i b \pi x}{2}+\frac {b c \ln \left (-c^{2}+x^{2}\right )}{2}\) | \(271\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.25, size = 29, normalized size = 1.00 \begin {gather*} \frac {1}{2} \, {\left (2 \, x \operatorname {artanh}\left (\frac {c}{x}\right ) + c \log \left (-c^{2} + x^{2}\right )\right )} b + a x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 35, normalized size = 1.21 \begin {gather*} \frac {1}{2} \, b c \log \left (-c^{2} + x^{2}\right ) + \frac {1}{2} \, b x \log \left (-\frac {c + x}{c - x}\right ) + a x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.10, size = 24, normalized size = 0.83 \begin {gather*} a x + b \left (c \log {\left (- c + x \right )} + c \operatorname {atanh}{\left (\frac {c}{x} \right )} + x \operatorname {atanh}{\left (\frac {c}{x} \right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 150 vs.
\(2 (27) = 54\).
time = 0.41, size = 150, normalized size = 5.17 \begin {gather*} a x + \frac {{\left (c^{2} {\left (\log \left (\frac {{\left | -c - x \right |}}{{\left | c - x \right |}}\right ) - \log \left ({\left | -\frac {c + x}{c - x} - 1 \right |}\right )\right )} - \frac {c^{2} \log \left (-\frac {\frac {c {\left (\frac {c + x}{{\left (c - x\right )} c} + \frac {1}{c}\right )}}{\frac {c + x}{c - x} - 1} + 1}{\frac {c {\left (\frac {c + x}{{\left (c - x\right )} c} + \frac {1}{c}\right )}}{\frac {c + x}{c - x} - 1} - 1}\right )}{\frac {c + x}{c - x} + 1}\right )} b}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.68, size = 27, normalized size = 0.93 \begin {gather*} a\,x+b\,x\,\mathrm {atanh}\left (\frac {c}{x}\right )+\frac {b\,c\,\ln \left (x^2-c^2\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________